<%-- 
    Document   : ManageTourBooking
    Created on : Nov 2, 2011, 12:05:10 AM
    Author     : Mr-aUgust
--%>

<%@page pageEncoding="UTF-8"%>
<%@ page session="true" import="java.util.Collection, DAL.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<%
TourBookingBean tourBook=new TourBookingBean();
Collection coll=tourBook.getAllTourBooking();
request.setAttribute("tourAllBooking",coll);
%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>East2West Tours and Travels</title>
        <link rel="stylesheet" href="../css/style.css" />   
        <style>
            .a
            {
            color:red;
            }
        </style>
    </head>
    <body>
        <br/>
        <div id="tablewrapper">
            <div id="tableheader">
                <div class="search">
                    <select id="columns" onchange="sorter.search('query')"></select>
                    <input type="text" id="query" onkeyup="sorter.search('query')"/>
                </div>
                <span class="details">
                    <div>Records <span id="startrecord"></span>-<span id="endrecord"></span> of <span id="totalrecords"></span></div>
                    <div><a href="javascript:sorter.reset()">reset</a></div>
                </span>
            </div>
            <h2>Tour Booking Management </h2>    
            <table cellpadding="0" cellspacing="0" border="0" id="table" class="tinytable">
                <thead>
                    <tr>                    
                        <th class="nosort">					
                                  
                        <h3>UserName</h3></th>
                        <th><h3>TourID</h3></th>
                        <th><h3>TotalOfGuest</h3></th>
                        <th><h3>TypeTour</h3></th>
                        <th><h3>TotalMoney $</h3></th>
                        <th><h3>StartDate</h3></th>   
                        <th><h3>EndDate</h3></th>   
                        <th><h3>DateBooking</h3></th>   
                        <th><h3>TourCancel</h3></th>   
                         
                        <th><h3>Del</h3></th> 
                        
                    </tr>
                </thead>
                <tbody>
                    
                    <c:forEach items="${tourAllBooking}" var="tAllBook">        
                        <tr>              	
                           
                            <td class="">${tAllBook.userName}</td>
                            <td class="">${tAllBook.tourId}</td>
                            <td class="">${tAllBook.totalOfGuest}</td>
                            <td class="">${tAllBook.typeTour}</td>
                            <td class="">${tAllBook.totalMoney}</td>
                            <td class="">${tAllBook.startDate}</td>
                            <td class="">${tAllBook.endDate}</td>
                            <td class="">${tAllBook.dateBooking}</td>  
                            <td class="">${tAllBook.tourCancel}</td>
                          
                            <td class=""><a class="a" href='../ControllerDelTourBoking?bookingId=${tAllBook.bookingId}' title="Click here to delete" onClick="return confirm('Are you sure to delete?')" name="deleteTouBooking" value="deleteTouBooking">Del</a></td>  
                            
                        </tr>                    
                    </c:forEach>     
                    
                </tbody>
            </table>
            <div id="tablefooter">
                <div id="tablenav">
                    <div>
                        <img src="../images/first.gif" width="16" height="16" alt="First Page" onclick="sorter.move(-1,true)"/>
                        <img src="../images/previous.gif" width="16" height="16" alt="First Page" onclick="sorter.move(-1)"/>
                        <img src="../images/next.gif" width="16" height="16" alt="First Page" onclick="sorter.move(1)"/>
                        <img src="../images/last.gif" width="16" height="16" alt="Last Page" onclick="sorter.move(1,true)"/>
                    </div>
                    <div>
                        <select id="pagedropdown"></select>
                    </div>
                    <div>
                        <a class="a" href="javascript:sorter.showall()">view all</a>
                    </div>
                </div>
                <div id="tablelocation">
                    <div>
                        <select onchange="sorter.size(this.value)">
                            <option value="5">5</option>
                            <option value="10" selected="selected">10</option>
                            <option value="20">20</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                        <span>Entries Per Page</span>
                    </div>
                    <div class="page">Page <span id="currentpage"></span> of <span id="totalpages"></span></div>
                </div>
            </div>
        </div>
        <script type="text/javascript" src="../js/script.js"></script>
        <script type="text/javascript">
	var sorter = new TINY.table.sorter('sorter','table',{
		headclass:'head',
		ascclass:'asc',
		descclass:'desc',
		evenclass:'evenrow',
		oddclass:'oddrow',
		evenselclass:'evenselected',
		oddselclass:'oddselected',
		paginate:true,
		size:10,
		colddid:'columns',
		currentid:'currentpage',
		totalid:'totalpages',
		startingrecid:'startrecord',
		endingrecid:'endrecord',
		totalrecid:'totalrecords',
		hoverid:'selectedrow',
		pageddid:'pagedropdown',
		navid:'tablenav',
		sortcolumn:1,
		sortdir:1,
		sum:[4],		
		
		columns:[{index:4, format:'$', decimals:0}],
		init:true
	});
        </script>        
        
    </body>
</html>

